using System.Runtime.InteropServices;
using System;

namespace Recast
{
	public unsafe partial class RecastGlobal
	{
		[StructLayout(LayoutKind.Sequential)]
		public unsafe partial struct rcContourSet : IDisposable
		{
			public rcContour* conts;
			public int nconts;
			public fixed float bmin[3];
			public fixed float bmax[3];
			public float cs;
			public float ch;
			public int width;
			public int height;
			public int borderSize;
			public float maxError;

			public void Dispose()
			{
				for (int i = 0; i < nconts; ++i)
				{
					rcFree(conts[i].verts);
					rcFree(conts[i].rverts);
				}
				rcFree(conts);
			}
		}
	}
}
